package data.platform.common.stream.valueobjects;

public enum WindowType {
    MINUTE("分钟"),
    HOUR("小时"),
    DAY("天"),
    MONTH("月"),
    YEAR("年");

    private String name;

    WindowType(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static WindowType fromString(String name) {
        for (WindowType b : WindowType.values()) {
            if (b.name.equals(name)) {
                return b;
            }
        }
        return null;
    }
}
